package JavaSE.CODE.javaThread.concurrent;

public class TicketsIntro implements Runnable{
    private int tickets = 10;
    @Override
    public void run() {
        while(true){
            if(tickets<=0) break;
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+"拿到了第" + tickets-- + "张票");
        }
    }
}
